#include <QCoreApplication>
#include <iostream>
using namespace std;
int main()
{
    int d,n;
      cout<<"Vvedite den' goda:\n ";
      cin>>d;
      cout<<"Vvedite nomer dnya nedeli:\n ";
      cin>>n;
       d = d % 7;
       d = d + (n - 1);
       switch(d)
       {
          case 0 :
          {
             cout<<"Voskresen'e\n";
                break;
          }
          case 1 :
          {
             cout<<"Ponedel'nik\n";
                break;
          }
          case 2 :
          {
             cout<<"Vtornik\n";
                break;
          }
          case 3 :
          {
            cout<<"Sreda\n";
                break;
          }
          case 4 :
          {
         cout<<"Chetverg\n";
                break;
          }
          case 5 :
          {
             cout<<"Pyatnica\n";
                break;
          }
          case 6 :
          {
            cout<<"Subbota\n";
                break;
          }
       }

       return 0;
}
